package class_code;

public class 最大子序列和{
    public static void main(String[] args){
        
        int[] arr = {2,-2,3,-1,9,-19,20};
        
        int res = 0;
        
        for(int i = 0;i<arr.length;i++){
            if (arr[i] > 0){
                res += arr[i];
            }
        }
        System.out.println(res);
    }
}